//
//  HJChatGroupManagerProtocol.h
//  KaiChat
//
//  Created by lx on 2023/10/23.
//

#import <Foundation/Foundation.h>

@class HJChatGroupModel, HJGroupMemberModel, HJGroupInviteModel, HJChatMessageModel;

NS_ASSUME_NONNULL_BEGIN

@protocol HJChatGroupManagerProtocol <NSObject>

- (void)queryGroupInfoByGroupId:(NSString *)groupId completion:(void (^)(HJChatGroupModel * _Nullable groupModel))completion;
- (HJChatGroupModel *)queryGroupInfoByGroupId:(NSString *)groupId;
- (void)createGroupWithUserIds:(NSArray *)userIds completion:(void (^)(HJChatGroupModel * _Nullable groupModel, NSError * _Nullable error))completion;
- (void)loadGroupListWithCompletion:(void (^)(NSArray <NSArray <HJChatGroupModel *>*>* _Nullable datas))completion;
- (void)queryGroupListWithCompletion:(void (^)(NSArray <NSArray <HJChatGroupModel *>*>* _Nullable datas))completion;
- (void)openGroupInviteVerifyWithGroupId:(NSString *)groupId open:(BOOL)open completion:(void (^)(NSError * _Nullable error))completion;
- (void)loadGroupInfoByGroupId:(NSString *)groupId completion:(void (^)(HJChatGroupModel * _Nullable groupModel))completion;

- (void)loadGroupMemberListWithGroupId:(NSString *)groupId completion:(void (^)(NSArray <HJGroupMemberModel *>* _Nullable datas))completion;
- (void)queryGroupMemberListWithGroupId:(NSString *)groupId completion:(void (^)(NSArray <HJGroupMemberModel *>* _Nullable datas))completion;
- (NSArray *)queryGroupMemberListWithGroupId:(NSString *)groupId;

- (void)editGroupInfoByGroupId:(NSString *)groupId avatar:(NSString *)avatar name:(NSString *)name intro:(nullable NSString *)intro completion:(void (^)(HJChatGroupModel * _Nullable groupModel))completion;
- (void)searchGroupByKeyword:(NSString *)keyword completion:(void (^)(NSArray <HJChatGroupModel *> * _Nullable datas))completion;
- (void)postGroupNoticeByGroupId:(NSString *)groupId content:(NSString *)content completion:(void (^)(NSError * _Nullable error))completion;
- (void)loadGroupNoticeDetailByGroupId:(NSString *)groupId completion:(void (^__nullable)(NSDictionary * _Nullable data))completion;

- (void)inviteFridendJoinGroupByGroupId:(NSString *)groupId userModels:(NSArray *)userModels completion:(void (^)(NSError * _Nullable error))completion;

- (void)inviteFridendJoinGroupByGroupId:(NSString *)groupId userIds:(NSArray *)userIds completion:(void (^)(NSError * _Nullable error))completion;
- (void)removeGroupMemberByGroupId:(NSString *)groupId userIds:(NSArray *)userIds completion:(void (^)(NSError * _Nullable error))completion;
- (void)addGroupManagerByGroupId:(NSString *)groupId userIds:(NSArray *)userIds completion:(void (^)(NSError * _Nullable error))completion;
- (void)removeGroupManagerByGroupId:(NSString *)groupId userIds:(NSArray *)userIds completion:(void (^)(NSError * _Nullable error))completion;
- (void)exitGroupByGroupId:(NSString *)groupId completion:(void (^)(NSError * _Nullable error))completion;
- (void)disbandGroupByGroupId:(NSString *)groupId completion:(void (^)(NSError * _Nullable error))completion;
- (void)transferGroupByGroupId:(NSString *)groupId userId:(NSString *)userId completion:(void (^)(NSError * _Nullable error))completion;
- (void)loadGroupInviteListWithGroupId:(NSString *)groupId completion:(void (^)(NSArray  <HJGroupInviteModel *>* _Nullable datas))completion;
- (void)loadGroupInviteCountWithGroupId:(NSString *)groupId complete:(void (^__nullable)(NSInteger count))complete;
- (void)agreeUserJoinGroupByGroupId:(NSString *)groupId userIds:(NSArray *)userIds completion:(void (^)(NSError * _Nullable error))completion;
- (HJChatMessageModel *)queryGroupLastNoticeByGroupId:(NSString *)groupId;
- (NSArray *)groupMemberModelsSort:(NSArray *)datas;
- (void)joinGroupInfoByGroupId:(NSString *)groupId completion:(void (^)(NSError * _Nullable error))completion;
- (void)loadPublicGroupInfoByGroupId:(NSString *)groupId completion:(void (^)(HJChatGroupModel * _Nullable groupModel, NSError * _Nullable error))completion;

@end

NS_ASSUME_NONNULL_END
